/**
 *Copyright (c) 2024 watereyes
 * workflow is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.workflow.baseConfig.service;

import com.koron.workflow.baseConfig.bean.DepartmentStaffBean;
import com.koron.workflow.baseConfig.bean.PostBean;
import com.koron.workflow.common.bean.PageBean;
import com.koron.workflow.common.bean.StaffBean;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

import java.util.List;

/**
 * @author qingfeng
 * @description: TODO
 * @date 2020/4/13 11:51
 */
public interface PostService {

    /**
     * 分页查询
     * @param factory
     * @param name
     * @param page
     * @param pageSize
     * @return
     */
    PageBean<PostBean> queryForList(SessionFactory factory, String name, Integer page, Integer pageSize);

    /**
     * 保存
     * @param factory
     * @param post
     */
    MessageBean<String> save(SessionFactory factory, PostBean post, StaffBean user);

    /**
     * 删除
     * @param factory
     * @param id
     */
    void delete(SessionFactory factory,String id);

    /**
     * 查询详情
     * @param factory
     * @param id
     * @return
     */
    PostBean queryForObject(SessionFactory factory,String id);

    /**
     *删除岗位用户关系
     * @param factory
     * @param id
     */
    void deletePostStaffRel(SessionFactory factory,String id);
    
    /**
     * 查询岗位所属用户
     * @param factory
     * @param postId
     * @return
     */
    List<StaffBean> queryPostStaff(SessionFactory factory, String postId);

    /**
     * 查询岗位所属用户
     * @param factory
     * @param postId
     * @param departmentName
     * @param staffName
     * @return
     */
    List<DepartmentStaffBean> queryPostStaff(SessionFactory factory,String postId,String departmentName,String staffName);

    /**
     * 更新岗位用户
     * @param factory
     * @param postId
     * @param staffId
     */
    void updatePostStaffRel (SessionFactory factory,String postId,String staffId);
}
